package com.mini.cn.goods.servlet.ws;


import com.mini.cn.goods.io.netty.io.IFourLayerConfig;
import com.mini.cn.goods.io.netty.io.IFourLayerServerStateListener;
import lombok.extern.slf4j.Slf4j;


/**
 * Created with IntelliJ IDEA.
 * User: fly
 * Date: 2020-02-06
 * Time: 11:03 下午
 */
@Slf4j
public class PushServerListener implements IFourLayerServerStateListener {

    DirectMemoryReporterImpl directMemoryReporter;

    @Override
    public void onServiceOnReady(IFourLayerConfig config) {

    }

    @Override
    public void onServiceOnStart(int port) {
        log.info("onServiceOnStart!!");
    }

    @Override
    public void onServiceOnStop(int port) {
        log.info("onServiceOnStop!!");
        clearCache();
    }

    private void clearCache() {
//        WSApplicationData.INSTANCE.getUserSessionMap().clear();
//        WSApplicationData.INSTANCE.getRegisterMsgMap().clear();
//        WSApplicationData.INSTANCE.getResponseCache().clear();
//        WSApplicationData.INSTANCE.getMsgSceneIdRegisterMap().clear();
//        WSApplicationData.INSTANCE.getMsgSceneIdUnRegisterMap().clear();
//        WSApplicationData.INSTANCE.getMsgSceneIdVerifyMap().clear();
    }

}
